$(function(){
	//获取微信js-sdk配置参数
	$.ajax({
		type:'post',
		url:url() + "/wechat/getWxConfig",
		dataType:'json',
		success:function(result,sta,xhr) {
			var sessionstatus = xhr.getResponseHeader('sessionstatus');
			
			if(sessionstatus == '302'){
				window.location.href = url() + '/wxuser/goCompleteInfo';
			};
			console.log(result);
			localStorage.wxconfig = JSON.stringify(result);
			var wxconfig = JSON.parse(localStorage.wxconfig);
			var wxconfigResult = JSON.parse(wxconfig.result);
			if(wxconfig.code ==0){
				if(wxconfigResult.status ==0) {
					var wxconfigObject = wxconfigResult.object;
					wx.config({
						debug: false,
						appId: wxconfigObject.appId,
						timestamp: wxconfigObject.timestamp,
						nonceStr: wxconfigObject.nonce,
						signature: wxconfigObject.sig,
						jsApiList: [
							'hideOptionMenu'
						]
					});
					wx.ready(function(){
						wx.hideOptionMenu();
					});
				}else{
					//alert(wxconfigResult.message);
				}
			}else{
				//alert(wxconfig.result);
			}
		},
		error:function(){
			//alert('error')
		}
	});
})
	